import { createRouter, createWebHistory } from 'vue-router'

export const testTabsRoute = [
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/UseTabs.vue')
  },
  {
    path: '/news',
    name: 'News',
    component: () => import('@/views/UseTabs.vue')
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('@/views/UseTabs.vue')
  },
  {
    path: '/contact',
    name: 'Contact',
    component: () => import('@/views/UseTabs.vue')
  },
  {
    path: '/recruit',
    name: 'Recruit',
    component: () => import('@/views/UseTabs.vue')
  }
]

export const routes = [
  {
    path: '/steps',
    name: '步骤条',
    component: () => import('@/views/UseSteps.vue')
  },
  {
    path: '/verify',
    name: '验证码输入框',
    component: () => import('@/views/UseVerify.vue')
  },
  {
    path: '/cascader',
    name: '级联选择器',
    component: () => import('@/views/UseCascader.vue')
  },
  {
    path: '/pagination',
    name: '分页器',
    component: () => import('@/views/UsePagination.vue')
  },
  {
    path: '/select',
    name: '选择器',
    component: () => import('@/views/UseSelect.vue')
  },
  {
    path: '/tree',
    name: '树',
    component: () => import('@/views/UseTree.vue')
  },
  {
    path: '/tabs',
    name: '标签页',
    component: () => import('@/views/UseTabs.vue')
  },
  {
    path: '/slider',
    name: '滑动条',
    component: () => import('@/views/UseSlider.vue')
  },
  {
    path: '/swich',
    name: '开关',
    component: () => import('@/views/UseSwitch.vue')
  },
  {
    path: '/drawer',
    name: '抽屉',
    component: () => import('@/views/UseDrawer.vue')
  },
  {
    path: '/popover',
    name: '气泡卡片',
    component: () => import('@/views/UsePopover.vue')
  },
  {
    path: '/tooltip',
    name: '文字提示',
    component: () => import('@/views/UseTooltip.vue')
  },
  {
    path: '/dialog',
    name: '对话框',
    component: () => import('@/views/UseDialog.vue')
  },
  {
    path: '/message',
    name: '消息提示',
    component: () => import('@/views/UseMessage.vue')
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/message'
    },
    ...routes,
    ...testTabsRoute
  ]
})

export default router
